package ooday05;

public class EnumDemo {
    public static void main(String[] args) {
        Season s =Season.WINTER;
        System.out.println(s.getSeasonName()+s.getSeasonDesc());
        switch (s){
            case SPRING:
                System.out.println("天气"+s.getSeasonDesc());
                break;
            case SUMMER:
                System.out.println("天气"+s.getSeasonDesc());
                break;
            case AUTUMN:
                System.out.println("天气"+s.getSeasonDesc());
                break;
            case WINTER:
                System.out.println("天气"+s.getSeasonDesc());
                break;
        }

        Season[] seasons = Season.values();//获取所有枚举对象
        for (int i = 0; i <seasons.length ; i++) {
            System.out.println(seasons[i]);
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonDesc());
        }


    }
}
